package com.sc.nft.dao;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.vo.DaoEcologyPointsDetailVO;
import com.sc.nft.enums.DaoEcologyPointsDetailAmountTypeEnum;
import com.sc.nft.enums.DaoEcologyPointsDetailRecordsTypeEnum;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.DaoEcologyPointsDetail;
import com.sc.nft.mapper.DaoEcologyPointsDetailMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

/**
 * DAO-生态燃料余额变动记录表(sc_dao_ecology_points_detail)数据DAO
 *
 * @author Sun
 * @since 2023-12-06 18:45:44
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class DaoEcologyPointsDetailDao extends ServiceImpl<DaoEcologyPointsDetailMapper, DaoEcologyPointsDetail> {

    public IPage<DaoEcologyPointsDetailVO> ecologyPointsDetailPage(Long id, DaoEcologyPointsDetailAmountTypeEnum amountType, DaoEcologyPointsDetailRecordsTypeEnum type, Page page) {
        return baseMapper.ecologyPointsDetailPage(page,id, ObjectUtil.isNull(amountType) ?  0 : amountType.getCode(), ObjectUtil.isNull(type) ? 0 : type.getCode());
    }
}